import { computed } from 'vue'
import { useAppStore } from '@/store/modules/app'

export function useRootSetting() {
  const appStore = useAppStore()

  const getPageLoading = computed(() => appStore.getPageLoading)

  const getOpenKeepAlive = computed(() => appStore.getProjectConfig.openKeepAlive)

  const getSettingButtonPosition = computed(() => appStore.getProjectConfig.settingButtonPosition)

  const getCanEmbedIFramePage = computed(() => appStore.getProjectConfig.canEmbedIFramePage)

  const getUseOpenBackTop = computed(() => appStore.getProjectConfig.useOpenBackTop)

  const getShowSettingButton = computed(() => appStore.getProjectConfig.showSettingButton)

  const getUseErrorHandle = computed(() => appStore.getProjectConfig.useErrorHandle)

  const getFullContent = computed(() => appStore.getProjectConfig.fullContent)

  return {
    getSettingButtonPosition,
    getFullContent,
    getPageLoading,
    getOpenKeepAlive,
    getCanEmbedIFramePage,
    getUseErrorHandle,
    getUseOpenBackTop,
    getShowSettingButton,
  }
}
